<html>

   <head>
      <title>Highcharts (runoob.com)</title>
      <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
      <script src="http://code.highcharts.com/highcharts.js"></script>
      <script src="http://code.highcharts.com/modules/data.js"></script>
   </head>

   <body>
      <div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div>
      <script language="JavaScript">
         var options = {
            chart: {
                defaultSeriesType: 'column'
            },
            title: {
                text: 'Fruit Consumption'
            },
            xAxis: {
                categories: []
            },
            yAxis: {
                title: {
                    text: 'Units'
                }
            },
            series: []
        };
      Highcharts.ajax({
         url: 'fruit.csv',
         dataType: 'text',
         success: function(data) {
             // Split the lines
             var lines = data.split('\n');
             lines.forEach(function(line, lineNo) {
                 var items = line.split(',');

                 // header line containes categories
                 if (lineNo == 0) {
                     items.forEach(function(item, itemNo) {
                         if (itemNo > 0) options.xAxis.categories.push(item);
                     });
                 }

                 // the rest of the lines contain data with their name in the first position
                 else {
                     var series = {
                         data: []
                     };
                     items.forEach(function(item, itemNo) {
                         if (itemNo == 0) {
                             series.name = item;
                         } else {
                             series.data.push(parseFloat(item));
                         }
                     });

                     options.series.push(series);

                 }

             });

             Highcharts.chart('container', options);
         },
         error: function (e, t) {
             console.error(e, t);
         }
     });
      </script>
   </body>

</html>